package com.zj.fx.model.rpa;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class RpaTransdata implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "业务类型编码")
    private String typenum;

    @ApiModelProperty(value = "业务类型名称")
    private String typename;

    @ApiModelProperty(value = "三方系统数据id")
    private String thirdid;

    @ApiModelProperty(value = "指标年月")
    private String taskmonth;

    @ApiModelProperty(value = "分公司名称")
    private String subcompanyname;

    @ApiModelProperty(value = "外系统供电所名称")
    private String supplyname;

    @ApiModelProperty(value = "内部供电所id")
    private String selfsupplyid;

    @ApiModelProperty(value = "内部供电所名称")
    private String selfsupplyname;

    @ApiModelProperty(value = "数据描述")
    private String datamemo;

    @ApiModelProperty(value = "数据值")
    private String value;

    @ApiModelProperty(value = "对应指标id")
    private String targetid;

    @ApiModelProperty(value = "对应月度任务id")
    private String taskid;

    @ApiModelProperty(value = "是否完成数据自动填写（0否1是）")
    private String isfinish;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "数据进表时间")
    private Date createtime;


    public RpaTransdata(String id, String typenum, String typename, String thirdid, String taskmonth, String subcompanyname, String supplyname, String selfsupplyid, String selfsupplyname, String datamemo, String value, String targetid, String taskid, String isfinish, Date createtime) {

        this.id = id;

        this.typenum = typenum;

        this.typename = typename;

        this.thirdid = thirdid;

        this.taskmonth = taskmonth;

        this.subcompanyname = subcompanyname;

        this.supplyname = supplyname;

        this.selfsupplyid = selfsupplyid;

        this.selfsupplyname = selfsupplyname;

        this.datamemo = datamemo;

        this.value = value;

        this.targetid = targetid;

        this.taskid = taskid;

        this.isfinish = isfinish;

        this.createtime = createtime;

    }

    public RpaTransdata() {
        super();
    }

    public String dateToStringConvert(Date date) {
        if (date != null) {
            return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        }
        return "";
    }


}